

/*********************************************************************************/
/*                                                                               */ 
/* Decompose change in earned income into intensive and extensive margin changes */
/*                                                                               */ 
/*********************************************************************************/



libname common 'G:\Data\Workdata\707677\Common\01Data\01SAS';



/* Compute mean earned income of those who were employed before and after debt relief */



data panel;

set common.panel;

keep pnr granted employed_pstill erhvervsindk_real time aar;

run;



data panel;

set panel;

if time>-5 and time<17;

run;



proc summary data=panel;

output out=before

mean(erhvervsindk_real)=earn_before;

where time<0 and employed_pstill=1;

run;



data before;

set before;

drop _type_ _freq_;

run;




proc summary data=panel;

output out=after

mean(erhvervsindk_real)=earn_after;

where time>0 and employed_pstill=1;

run;



data after;

set after;

drop _type_ _freq_;

run;




/* Make decomposition */


proc sql;

create table decomposition as select *

from after as a cross join 

before as b;

quit;



/* Enter parameters for change in income and employment from IV estimates */


data decomposition;

set decomposition;

dI=46800;	/* Change earned income */

dE=0.117;   /* Change employment */

run;



data decomposition;

set decomposition;

dbefore=dE*earn_before/dI;

dafter=dE*earn_after/dI;

run;




data decomposition;

set decomposition;

dmean=ROUND((dbefore+dafter)/2,0.01);

run;






proc datasets library=work kill nolist;

quit;


